mudbox::TangentGenerator Class Reference

#include <mesh.h>

Inheritance diagram for mudbox::TangentGenerator:

Inheritance graph
[legend]
List of all members.

Detailed Description

TangentGenerator is a class that defines the tangent space used by Mesh objects.

"Tangent space" is a coordinate system defined per vertex on a mesh, with its coordinate basis defined by the normal vector (which points away from the mesh), and the binormal and tangent vectors which are all orthagonal to each other. They can be calculated in different ways.

TangentGenerator is derived from TreeNode, so that it can be made a child of the mesh.

If your graphics pipeline demands its own particular way of defining tangent space, you can override this class and its methods. To create your own:

1. Write a plug-in that defines your own class derived from TangentGenerator.

2. If you need to, override the TreeNode::OnLinked() method. This will be called when your TangentGenerator node is linked to a mesh object. You can initialize any internal data.

3. Delete the existing TangentGenerator plugin, and copy yours into the plug-in folder.

On OSX, this plugin (TangentGenerator.dylib) is found in the Mudbox 2010 package, under Contents>MacOS>plugins. On the PC, it is found in the work dir folder, under "plugins"


Public Member Functions

virtual const mudbox::ClassDesc RuntimeClass (void) const
virtual Vector  ConvertToTangent (unsigned int iVertexIndex, const Vector &vVector) const
  Convert an object space vector to tangent space.
virtual Vector  ConvertToObject (unsigned int iVertexIndex, const Vector &vVector) const
  Convert a tangent space vector to object space.
virtual const Base LocalBase (unsigned int iFaceIndex, unsigned int iCornerIndex)
  Returns the Base of the tangent space for a face vertex (a=tangent, b=normal, c=binormal).
virtual void  SetNormalization (bool bNormalize)
  Turns normalization for the tangent and binormal vectors on or off.

Static Public Member Functions

const mudbox::ClassDesc StaticClass (void)
mudbox::Node CreateInstances (unsigned int iCount=1)

Member Function Documentation

virtual const mudbox::ClassDesc* mudbox::TangentGenerator::RuntimeClass void   )  const [inline, virtual]
 

Reimplemented from mudbox::TreeNode.

00689 :
const mudbox::ClassDesc* mudbox::TangentGenerator::StaticClass void   )  [static]
 

Reimplemented from mudbox::TreeNode.

mudbox::Node* mudbox::TangentGenerator::CreateInstances unsigned int  iCount = 1  )  [static]
 

Reimplemented from mudbox::TreeNode.

virtual Vector mudbox::TangentGenerator::ConvertToTangent unsigned int  iVertexIndex,
const Vector vVector
const [virtual]
 

Convert an object space vector to tangent space.

Parameters:
iVertexIndex  [in] index of the associated vertex
vVector  [in] object space vector to be converted to tangent space
virtual Vector mudbox::TangentGenerator::ConvertToObject unsigned int  iVertexIndex,
const Vector vVector
const [virtual]
 

Convert a tangent space vector to object space.

Parameters:
iVertexIndex  [in] index of the associated vertex
vVector  [in] tangent space vector to be converted to object space
virtual const Base& mudbox::TangentGenerator::LocalBase unsigned int  iFaceIndex,
unsigned int  iCornerIndex
[virtual]
 

Returns the Base of the tangent space for a face vertex (a=tangent, b=normal, c=binormal).

Parameters:
iFaceIndex  [in] index of the face
iCornerIndex  [in] corner index of the vertex in question (0 to 2 for triangular faces, 0 to 3 for quads)
virtual void mudbox::TangentGenerator::SetNormalization bool  bNormalize  )  [virtual]
 

Turns normalization for the tangent and binormal vectors on or off.

Parameters:
bNormalize  [in] If true, tangent and binormal vectors will be normalized.

mudbox::TangentGenerator mudbox::TangentGenerator mudbox::TangentGenerator mudbox::TangentGenerator mudbox::TangentGenerator mudbox::TangentGenerator mudbox::TangentGenerator mudbox::TangentGenerator mudbox::TangentGenerator mudbox::TangentGenerator
mudbox::TangentGenerator mudbox::TangentGenerator mudbox::TangentGenerator mudbox::TangentGenerator mudbox::TangentGenerator mudbox::TangentGenerator mudbox::TangentGenerator mudbox::TangentGenerator mudbox::TangentGenerator mudbox::TangentGenerator